//
//  ZiXunTableViewCell.m
//  MyYiJianKangApp
//
//  Created by 张国文 on 16/5/4.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//

#import "ZiXunTableViewCell.h"

@implementation ZiXunTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addMySubview];
    }
    return self;
}

// 布局
- (void)addMySubview
{
    self.ziXunImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, 12 * kAdjustParamater, 77 * kAdjustParamater, 60 * kAdjustParamater)];
  //  self.ziXunImageV.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    [self.contentView addSubview:_ziXunImageV];
    
    self.ziXunTitle = [[UILabel alloc] initWithFrame:CGRectMake(self.ziXunImageV.right + 10 * kAdjustParamater, self.ziXunImageV.top + 3 * kAdjustParamater, 256 * kAdjustParamater, 15 * kAdjustParamater)];
  //  self.ziXunTitle.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    self.ziXunTitle.textColor = [UIColor blackColor];
    self.ziXunTitle.textAlignment = NSTextAlignmentLeft;
    self.ziXunTitle.font = [UIFont systemFontOfSize:k16Big];
    [self.contentView addSubview:_ziXunTitle];
    
    self.ziXunContent = [[UILabel alloc] initWithFrame:CGRectMake(self.ziXunTitle.left, self.ziXunTitle.bottom + 5 * kAdjustParamater, 256 * kAdjustParamater, 35 * kAdjustParamater)];
 //   self.ziXunContent.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    self.ziXunContent.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.6];
    self.ziXunContent.font = [UIFont systemFontOfSize:k13Big];
    self.ziXunContent.numberOfLines = 0;
    [self.contentView addSubview:_ziXunContent];
    
    
}

- (void)setModel:(ZiXunModel *)model
{
    [self.ziXunImageV sd_setImageWithURL:[NSURL URLWithString:model.thumb_url] placeholderImage:[UIImage imageNamed:@""]];
    self.ziXunTitle.text = model.title;
    self.ziXunContent.text = model.myDescription;
}


@end
